<?php
//config.php

//** Error Handling
require('error.php');
require('sanitize.php');

if(isset($authorizedPage)){

//** Session Information
session_start();


//** Database information
//** This will be different for each local version of the site.
$db_name 		= 'food';
$db_username 	= 'root';
$db_password 	= '';

//** Change to false if mysql not installed
$mysql_on = true;

if($mysql_on){
	mysql_connect('localhost',$db_username,$db_password) or die(mysql_error());
	mysql_select_db($db_name) or die(mysql_error());
}


//**	Facebook Functions
require('facebook/f_development.php');

//** Misc Functions

//**	get_full_url()
//return	Returns the entire current url
function get_full_url(){
	return "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}


//** rand_string
//Source			http://www.lateralcode.com/creating-a-random-string-with-php/
//@$length			An integer that will determine the length of the random string
//return			Returns a random string of numbers and letters with lenght $length
function rand_string( $length ) {
	$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";	

	$str = "";
	
	$size = strlen( $chars );
	for( $i = 0; $i < $length; $i++ ) {
		$str .= $chars[ rand( 0, $size - 1 ) ];
	}

	return $str;
}

}
?>